package com.business.utils;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.util.HashMap;
import java.util.Map;

/**
 * Author:  lining17
 * Date :  2020-09-20
 */
public class LittleTool {

    public static void mapValueSum() {
        String str = "{\"1757\":992781,\"209\":468906,\"290\":169842,\"12604\":140273,\"8986\":103643,\"9194\":80556,\"23431\":79365," +
                "\"16242\":77112,\"15007\":73767,\"23208\":69631,\"12064\":68973,\"8971\":62370,\"20812\":57964,\"10248\":56228," +
                "\"4658\":50952,\"24045\":49089,\"34042\":41914,\"6359\":39782,\"838\":39740,\"2100\":38610,\"236\":35520," +
                "\"9518\":32992,\"10950\":32801,\"425\":32489,\"10741\":30460,\"24430\":27115,\"33441\":27083,\"34224\":26624," +
                "\"24700\":25782,\"38301\":25568,\"8573\":25462,\"3848\":24180,\"33016\":22796,\"22236\":22512,\"9383\":20058," +
                "\"12138\":19922,\"10680\":18540,\"10383\":18497,\"33043\":18169,\"8465\":18007,\"582\":17366,\"41163\":16935," +
                "\"20319\":16792,\"32415\":16707,\"27312\":16602,\"25503\":16474,\"35230\":16420,\"22263\":16411,\"21291\":16398," +
                "\"22270\":16219,\"37012\":15864,\"21325\":15781,\"21352\":15550,\"33144\":15071,\"10633\":14834,\"4199\":14705," +
                "\"35304\":14569,\"10653\":14536,\"54\":14429,\"34305\":14394,\"19300\":14234,\"17113\":13912,\"22560\":13488," +
                "\"22621\":12740,\"14521\":12275,\"61\":12191,\"22803\":12082,\"22216\":11826,\"10086\":11685,\"298\":11639," +
                "\"25260\":11603,\"17214\":11565,\"39779\":11299,\"34312\":11257,\"28122\":11240,\"22243\":11227,\"23512\":11172," +
                "\"24504\":11012,\"2579\":10676,\"7307\":10547,\"6197\":10483,\"24072\":10230,\"23505\":10157,\"38996\":10005," +
                "\"20515\":9846,\"22108\":9693,\"36121\":9489,\"12172\":9431,\"33603\":9077,\"10066\":8816,\"35041\":8612," +
                "\"34332\":8539,\"12246\":8470,\"12037\":8350,\"803\":8323,\"23613\":8318,\"32226\":8148,\"13731\":8110,\"12165\":8061," +
                "\"33090\":8053,\"23080\":8027,\"37997\":7595,\"17403\":7503,\"36600\":7498,\"14251\":7468,\"30093\":7324," +
                "\"22641\":7270,\"34204\":7171,\"25206\":7160,\"1958\":7140,\"27\":7090,\"34170\":7083,\"39003\":7068,\"13164\":6874," +
                "\"14136\":6871,\"25510\":6825,\"18301\":6802,\"11227\":6785,\"9572\":6733,\"37302\":6681,\"39300\":6426," +
                "\"22702\":6400,\"11308\":6343,\"19988\":6281,\"36310\":6171,\"858\":6119,\"37005\":6096,\"12084\":6053,\"21271\":6030," +
                "\"20292\":6020,\"2717\":5909,\"28203\":5856,\"26124\":5852,\"34035\":5828,\"21372\":5778,\"36998\":5690," +
                "\"21048\":5675,\"30343\":5627,\"15351\":5588,\"20724\":5577,\"23134\":5571,\"18024\":5492,\"18402\":5259," +
                "\"4759\":5246,\"35999\":5218,\"9545\":5128,\"7037\":5072,\"21264\":5071,\"4496\":5055,\"32307\":4987,\"8809\":4939," +
                "\"28102\":4930,\"10390\":4921,\"32550\":4893,\"13704\":4799,\"11281\":4786,\"28230\":4614,\"33171\":4542," +
                "\"4364\":4518,\"16303\":4506,\"32233\":4466,\"28014\":4451,\"6386\":4357,\"26340\":4313,\"23215\":4167,\"8519\":4161," +
                "\"23620\":4150,\"16701\":4120,\"24450\":4085,\"1796\":4074,\"14325\":4061,\"12145\":4051,\"9897\":4043,\"32172\":4032," +
                "\"10822\":4027,\"17140\":3937,\"14406\":3904,\"32253\":3865,\"26023\":3845,\"9923\":3837,\"14271\":3815," +
                "\"13515\":3761,\"32820\":3699,\"13441\":3602,\"21075\":3500,\"15108\":3475,\"8708\":3419,\"23701\":3406," +
                "\"36006\":3383,\"20102\":3262,\"26151\":3234,\"379\":3211,\"22054\":3173,\"21723\":3133,\"31713\":3120,\"21750\":3106," +
                "\"20346\":3082,\"11247\":3068,\"36141\":3062,\"24052\":3046,\"14163\":3021,\"14224\":3021,\"3686\":3009," +
                "\"21237\":2966,\"19030\":2955,\"27211\":2922,\"12354\":2906,\"6467\":2895,\"23370\":2886,\"23316\":2877," +
                "\"41305\":2860,\"12091\":2845,\"892\":2819,\"24160\":2814,\"38220\":2797,\"38888\":2793,\"25530\":2767,\"33009\":2750," +
                "\"25213\":2740,\"19111\":2711,\"6980\":2701,\"19131\":2682,\"9437\":2599,\"14244\":2580,\"23046\":2562,\"128\":2528," +
                "\"11111\":2495,\"25044\":2482,\"30525\":2480,\"21318\":2462,\"32631\":2460,\"23181\":2457,\"32118\":2453," +
                "\"34015\":2406,\"36114\":2403,\"6988\":2378,\"15027\":2326,\"16053\":2312,\"30200\":2271,\"6757\":2268,\"8357\":2217," +
                "\"33070\":2211,\"21020\":2192,\"14730\":2182,\"15034\":2134,\"15270\":2107,\"33117\":2099,\"16330\":2093," +
                "\"33502\":2092,\"641\":2078,\"23242\":2033,\"26131\":2024,\"14143\":2018,\"8087\":2016,\"14352\":1995,\"14332\":1975," +
                "\"30262\":1962,\"26016\":1943,\"30721\":1928,\"8762\":1894,\"40360\":1883,\"30228\":1869,\"21811\":1801," +
                "\"22074\":1784,\"40252\":1771,\"21028\":1743,\"41730\":1733,\"31902\":1708,\"22614\":1704,\"12361\":1697," +
                "\"26232\":1691,\"13630\":1664,\"18132\":1663,\"29978\":1654,\"30181\":1654,\"18510\":1649,\"33124\":1639," +
                "\"6872\":1637,\"20265\":1581,\"30613\":1551,\"20913\":1545,\"10930\":1468,\"18321\":1444,\"12462\":1428," +
                "\"12327\":1427,\"17133\":1424,\"38112\":1417,\"7118\":1341,\"32206\":1339,\"21183\":1337,\"21190\":1325," +
                "\"20704\":1310,\"40353\":1310,\"38699\":1292,\"24126\":1279,\"32064\":1252,\"11274\":1248,\"14622\":1237," +
                "\"11300\":1234,\"40137\":1194,\"39995\":1184,\"15115\":1157,\"41190\":1134,\"8797\":1128,\"30930\":1122," +
                "\"15162\":1105,\"20407\":1103,\"34231\":1045,\"20164\":1034,\"34521\":1012,\"393\":1009,\"40414\":997,\"17160\":976," +
                "\"41325\":966,\"12253\":953,\"41082\":937,\"23350\":935,\"5549\":932,\"40630\":931,\"15061\":899,\"30633\":880," +
                "\"21244\":878,\"17302\":868,\"26401\":867,\"20245\":865,\"36303\":854,\"32145\":845,\"40461\":830,\"19050\":830," +
                "\"15601\":816,\"30039\":797,\"22209\":795,\"20481\":782,\"19212\":780,\"14433\":778,\"5684\":774,\"19003\":772," +
                "\"25611\":753,\"22100\":747,\"11470\":728,\"23721\":702,\"2687\":691,\"32152\":689,\"4928\":684,\"17410\":683," +
                "\"37113\":683,\"7440\":680,\"26050\":675,\"8384\":662,\"11092\":660,\"17241\":655,\"13461\":645,\"16215\":636," +
                "\"13812\":633,\"8959\":626,\"649\":623,\"34413\":602,\"26421\":601,\"21345\":600,\"37140\":591,\"35115\":586," +
                "\"7844\":579,\"13326\":562,\"34420\":560,\"40001\":559,\"7442\":551,\"20623\":542,\"911\":535,\"30046\":534," +
                "\"15243\":531,\"21163\":524,\"23235\":513,\"35311\":510,\"14710\":509,\"14413\":500,\"12002\":483,\"12307\":481," +
                "\"22722\":473,\"24261\":470,\"13434\":460,\"40542\":460,\"10004\":459,\"16134\":456,\"42162\":455,\"12570\":442," +
                "\"13171\":438,\"155\":435,\"906\":433,\"40407\":431,\"7709\":429,\"41008\":428,\"37221\":421,\"26212\":417," +
                "\"7035\":411,\"10417\":407,\"17221\":407,\"32530\":406,\"10336\":402,\"14170\":393,\"14217\":390,\"11254\":389," +
                "\"9086\":385,\"35250\":373,\"42034\":370,\"18240\":361,\"1101\":360,\"35034\":360,\"34501\":357,\"28210\":355," +
                "\"11362\":352,\"32071\":345,\"15054\":345,\"13380\":343,\"40029\":335,\"10923\":326,\"39010\":322,\"30471\":322," +
                "\"25017\":320,\"1419\":316,\"40063\":315,\"40171\":315,\"26104\":313,\"22830\":295,\"16026\":295,\"20157\":292," +
                "\"24241\":275,\"23053\":267,\"25024\":260,\"32712\":258,\"41811\":257,\"22540\":246,\"40920\":246,\"23451\":244," +
                "\"21156\":242,\"17430\":240,\"38011\":235,\"10606\":233,\"30336\":231,\"41109\":225,\"40036\":224,\"25341\":222," +
                "\"14811\":221,\"22513\":215,\"692\":212,\"40245\":210,\"23424\":208,\"32523\":201,\"22027\":199,\"19104\":199," +
                "\"40434\":197,\"24801\":194,\"32901\":190,\"11490\":190,\"12219\":185,\"14305\":185,\"7169\":184,\"7631\":183," +
                "\"31821\":181,\"757\":181,\"14190\":175,\"17700\":173,\"12110\":172,\"42054\":171,\"36202\":171,\"23019\":171," +
                "\"15223\":171,\"24511\":168,\"40380\":160,\"20272\":160,\"20210\":159,\"7817\":156,\"33205\":152,\"23107\":152," +
                "\"20461\":151,\"40056\":150,\"40090\":149,\"777\":149,\"19799\":142,\"10444\":141,\"22128\":141,\"12523\":140," +
                "\"27400\":140,\"16161\":140,\"42216\":136,\"11436\":135,\"24207\":135,\"36013\":133,\"6333\":133,\"14602\":133," +
                "\"14028\":132,\"32017\":131,\"11003\":130,\"30390\":119,\"25152\":116,\"39968\":115,\"21055\":115,\"8924\":114," +
                "\"13306\":114,\"40083\":112,\"7871\":111,\"26502\":108,\"13001\":106,\"11409\":103,\"10031\":103,\"13353\":102," +
                "\"32800\":101,\"13407\":101,\"35122\":101,\"16141\":101,\"4955\":101,\"15621\":100,\"35203\":100,\"25314\":100," +
                "\"21804\":99,\"24403\":99,\"41143\":97,\"34123\":97,\"42081\":96,\"34116\":96,\"32314\":96,\"40117\":95,\"34062\":95," +
                "\"10707\":95,\"28311\":95,\"38031\":94,\"32442\":94,\"30417\":94,\"21217\":94,\"33360\":92,\"13920\":91,\"30910\":90," +
                "\"21703\":89,\"30363\":87,\"452\":86,\"36330\":86,\"26205\":85,\"40191\":84,\"22155\":84,\"2795\":82,\"33630\":81," +
                "\"30011\":80,\"36411\":80,\"41332\":79,\"41622\":79,\"35223\":78,\"24342\":78,\"40225\":75,\"40218\":73,\"21082\":73," +
                "\"22081\":70,\"18051\":70,\"865\":70,\"20427\":68,\"22047\":67,\"28898\":66,\"11382\":65,\"30741\":64,\"9877\":64," +
                "\"1499\":63,\"22162\":63,\"30444\":62,\"22911\":61,\"614\":61,\"24423\":61,\"42061\":58,\"24153\":58,\"31342\":58," +
                "\"40164\":57,\"29013\":57,\"11733\":55,\"21426\":55,\"9734\":53,\"37032\":50,\"10471\":50,\"12118\":50,\"21136\":49," +
                "\"30532\":49,\"40333\":48,\"17106\":48,\"993\":48,\"18989\":46,\"7987\":46,\"31335\":43,\"20137\":43,\"42115\":42," +
                "\"21730\":42,\"6737\":42,\"10220\":42,\"42142\":40,\"18105\":40,\"18112\":40,\"7361\":39,\"33414\":39,\"38004\":38," +
                "\"13272\":38,\"34008\":37,\"11902\":36,\"9491\":35,\"30255\":35,\"8681\":34,\"20218\":34,\"31362\":33,\"23026\":31," +
                "\"669\":30,\"22290\":30,\"40731\":30,\"11760\":28,\"20056\":28,\"41055\":27,\"40326\":27,\"40306\":26,\"24322\":26," +
                "\"5279\":25,\"4577\":25,\"4739\":25,\"20238\":24,\"30606\":24,\"12408\":23,\"20083\":23,\"13225\":23,\"15540\":22," +
                "\"4766\":22,\"12442\":21,\"5657\":20,\"22135\":20,\"40009\":19,\"14116\":19,\"22432\":19,\"30073\":18,\"40603\":18," +
                "\"40441\":17,\"34440\":17,\"12280\":17,\"4982\":16,\"1000\":15,\"11706\":14,\"5846\":14,\"38969\":13,\"7277\":13," +
                "\"40144\":13,\"5387\":13,\"40272\":13,\"18031\":13,\"1691\":13,\"17052\":13,\"10059\":13,\"42223\":12,\"31801\":11," +
                "\"33151\":11,\"30451\":11,\"21912\":10,\"41406\":10,\"3956\":10,\"32260\":9,\"30660\":9,\"22810\":8,\"11713\":8," +
                "\"15081\":8,\"42027\":7,\"11335\":7,\"15520\":7,\"29897\":7,\"30235\":7,\"33313\":7,\"30505\":7,\"9646\":6," +
                "\"18004\":6,\"10147\":6,\"26610\":6,\"20731\":5,\"13603\":5,\"10626\":5,\"27042\":5,\"33306\":5,\"588\":5,\"12057\":5," +
                "\"18220\":5,\"15324\":5,\"20535\":4,\"11328\":4,\"11355\":4,\"30903\":4,\"4685\":4,\"4847\":4,\"33522\":4,\"33711\":4," +
                "\"7116\":4,\"42007\":3,\"13414\":3,\"36040\":3,\"21831\":3,\"20832\":3,\"13711\":3,\"7574\":3,\"20940\":3,\"27103\":3," +
                "\"595\":3,\"29310\":3,\"1664\":3,\"32611\":3,\"11119\":3,\"7088\":3,\"30714\":3,\"12550\":2,\"33063\":2,\"32125\":2," +
                "\"8735\":2,\"3659\":2,\"9835\":2,\"23154\":2,\"25240\":2,\"696\":2,\"3794\":2,\"35601\":2,\"15142\":2,\"885\":2," +
                "\"19320\":2,\"22425\":2,\"13218\":2,\"17322\":2,\"19401\":2,\"12334\":1,\"42108\":1,\"38200\":1,\"34143\":1," +
                "\"12651\":1,\"28041\":1,\"30127\":1,\"20920\":1,\"29121\":1,\"533\":1,\"560\":1,\"10815\":1,\"11841\":1,\"27204\":1," +
                "\"19023\":1,\"35500\":1,\"3929\":1,\"3983\":1,\"21480\":1}";
        Map<String, Integer> map = new Gson().fromJson(str, new TypeToken<HashMap<String, Integer>>(){}.getType());
        int valueSum = map.values().stream().mapToInt(Integer::intValue).sum();
        int keySum = map.keySet().stream().mapToInt(Integer::parseInt).sum();
    }
}
